home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 22
/
022.d81
/
library manager
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
16KB
|
585 lines
220 dim k1$(3) :rem keyword table
250 dim s3(75) : rem screen variable field table
280 dim ah$(500) : rem author table
310 rem
340 rem load screen matrix's
370 rem
400 read a : rem figure out how many screen tables
430 for m = 0 to a-1 : i=m*25 : read s3(i)
460 for p = 1tos3(i) : read s3(p+i) : next p
490 next m
520 at = 0 : rem prime for one time author table load
550 p1$="2":p2$="1":z$=","
580 goto 1870
610 rem
640 rem field filling subroutine
670 rem
700 bt=0:c1=1:r1=0:b$="": rem initialize back tab, row/column and buffer
730 gosub 1300 : rem tab to next field
760 gosub 1540 : rem read a character
790 if a$=chr$(13) then b$=b$+" ":goto 1180
820 if a$<> chr$(20) then goto 1000: rem check for delete key
850 if(c1=1 and r1=0)then 760:rem leave alone if at first position
880 b$=left$(b$,len(b$)-1) : rem shrink buffer by one
910 if c1=1 then r1=r1-1: c1=s3(q+2):bt=c1-1:gosub 1300:goto 760
940 c1 = c1 - 1 :bt=c1-1: rem back up one position if in middle
970 gosub 1300:goto 760 : delete previous except at beginning of field
1000 b$ = b$ + a$
1030 c1=c1+1 : rem bump col count
1060 if c1<= s3(q+2) goto 760 : rem check if end of columns
1090 r1=r1+1:c1=1:bt=0 : rem yes
1120 if r1< s3(q+3) then gosub 1300:goto 760 : rem if not last row tab
1150 if r1 < s3(q+3) then 760 : rem end of row/field? if not read more
1180 return
1210 rem
1240 rem tabbing subroutine
1270 rem
1300 print "";
1330 print tab(s3(q+1)+bt-1);
1360 for r3 = 1 to (s3(q)-1)+r1:print "";:next r3
1390 print chr$(18)" [157]"; :rem space for back tab
1420 return
1450 rem
1480 rem the following are keyboard read and cursor blink subroutines
1510 rem
1540 get a$:if a$ = "" then gosub 1720:goto 1540
1570 ifa$=","ora$=";"ora$=":"thena$=" " : rem purge input delimiters
1600 if(a$<" " or a$>"_")and (a$<> chr$(13) and a$<> chr$(20)) then a$=" "
1630 if a$<>chr$(13) and a$<>chr$(20) then print a$;:ps=1
1660 if f<3 and ps=1 then print "[157]";:ps=0
1690 return
1720 print chr$(146)" [157]";:forx=1to200:next
1750 print chr$(18)" [157]";:forx=1to200:next:return
1780 rem
1810 rem main menu
1840 rem
1870 f = 1 : rem set to form one
1900 poke 53280,7:poke 53281,2
1930 print "";"[147]";""
1960 print " welcome to personal library manager!"
1990 print ""
2020 print " do you want"
2050 print ""
2080 print " to update"
2110 print ""
2140 print " or"
2170 print ""
2200 print " retrieve abstracts?"
2230 print ""
2260 print " type 'u' - update"
2290 print " 'r' - retrieve"
2320 print " 'h' - help"
2350 print " 'q' - quit"
2380 print ""
2410 print " -->[ ]<--";"[157][157][157][157][157]";
2440 gosub 1540
2470 if a$ = "q" then load"hello connect",8
2500 if a$ = "r" then gosub 5770
2530 if a$ = "u" then gosub 2740
2560 if a$ = "h" then gosub 16300
2590 if f<> 1 then goto 1870
2620 goto 2440
2650 rem
2680 rem this is the update form
2710 rem
2740 f = 2 : rem set to form two
2770 poke 53280,5:poke 53281,7
2800 print "";"[147]";""
2830 print " do you want to"
2860 print ""
2890 print " add or delete "
2920 print ""
2950 print " abstracts?"
2980 print ""
3010 print ""
3040 print " type 'a' - add"
3070 print " 'd' - delete"
3100 print " 'q' - quit"
3130 print ""
3160 print " -->[ ]<--";"[157][157][157][157][157]";
3190 gosub 1540
3220 if a$ = "q" then return
3250 if a$ = "a" then gosub 3460
3280 if a$ = "d" then gosub 4840
3310 if f <> 2 then goto 2740
3340 goto 3190
3370 rem
3400 rem this is the add form
3430 rem
3460 f = 3 : rem set to form three
3490 poke 53280,14:poke 53281,1
3520 print "";"[147]"
3550 if se=0 then goto 3610
3580 print " re-enter abstract data[146]":goto 3640
3610 print " add an abstract"
3640 print " abstract title - [146]"
3670 print tab(19)" [146]"
3700 print " author - [146]"
3730 print " document title - [146]"
3760 print " abstract date - [146]"
3790 print " abstract - [146]"
3820 print tab(19)" [146]"
3850 print tab(19)" [146]"
3880 print tab(19)" [146]"
3910 print " type 'return' - tab"
3940 print " 'p' - process"
3970 print " 'q' - quit"
4000 print " -->[ ]<--"
4030 q=1: rem initialize field pointer
4060 gosub 700:rem - 1st field
4090 f1$=b$
4120 q=1+(1*4)
4150 gosub 700:rem - 2nd field
4180 f2$=b$
4210 q=1+(2*4)
4240 gosub 700:rem - 3rd field
4270 f3$=b$
4300 q=1+(3*4)
4330 gosub 700:rem - 4th field
4360 f4$=b$
4390 q=1+(4*4)
4420 gosub 700:rem - 5th field
4450 f5$=b$
4480 q=1+(5*4)
4510 gosub 700 : rem - action field
4540 se=1
4570 if a$=chr$(13) then print chr$(146)" ";:goto 3520
4600 se=0
4630 if a$ = "p" then gosub 9460
4660 if a$ = "q" then return
4690 if f<> 3 then goto 3460
4720 goto 4480
4750 rem
4780 rem this is the delete form
4810 rem
4840 f = 5 : rem set to form five
4870 poke 53280,8:poke 53281,3
4900 print "";"[147]"
4930 print ""
4960 if se=0 then goto 5020
4990 print " [144] re-enter delete data[146]":goto 5050
5020 print " delete an abstract"
5050 print ""
5080 print " abstract title - [146]"
5110 print tab(19)" [146]"
5140 print ""
5170 print " type 'return' - tab"
5200 print " 'p' - process"
5230 print " 'q' - quit"
5260 print ""
5290 print " -->[ ]<--"
5320 q=26: rem initialize field pointer
5350 gosub 700:rem - 1st field
5380 f1$=b$
5410 q=26+(1*4)
5440 gosub 700 : rem - action field
5470 se=1
5500 if a$=chr$(13) then print chr$(146)" ";:goto 4900
5530 se=0
5560 if a$ = "p" then gosub 14470
5590 if a$ = "q" then return
5620 if f<> 5 then goto 4840
5650 goto 5410
5680 rem
5710 rem this is the retrieve form
5740 rem
5770 f = 6 : rem set to form six
5800 poke 53280,5:poke 53281,1
5830 print "";"[147]";""
5860 if se=0 then goto 5920
5890 print " re-enter retrieve data[146]":goto 5950
5920 print " retrieve an abstract"
5950 print " enter abstract title, author's name,"
5980 print " both, or '*' in author field (to see"
6010 print " all authors and their abstracts)."
6040 print " enter up to three keywords and a '$' "
6070 print " in author for keyword search."
6100 print " title/keywords - [146]"
6130 print tab(19)" [146]"
6160 print " author/*/$/ - [146]"
6190 print ""
6220 print " type 'return' - tab"
6250 print " 'p' - print"
6280 print " 'v' - view"
6310 print " 'q' - quit"
6340 print " -->[ ]<--"
6370 q=51
6400 gosub 700 : rem get 1st field
6430 f1$=b$
6460 q=51+(1*4)
6490 gosub 700 : rem get 2nd field
6520 f2$=b$
6550 q=51+(2*4)
6580 gosub 700 : rem get action field
6610 se=1
6640 if a$=chr$(13) then print chr$(146)" ";: goto 5830
6670 se=0
6700 if a$ = "p" or a$ = "v" then gosub 12250
6730 if a$ = "q" then return
6760 if f<> 6 then goto 5770
6790 goto 6550
6820 rem
6850 rem below are tables for managing the variable fields of the forms.
6880 rem each table contains the
6910 rem count of items in the data list, in sets of four, composed of
6940 rem start row/column, length and depth of field.
6970 rem
7000 data 3 : rem number of screen tables
7030 data 24,5,20,20,2,8,20,20,1,10,20,20,1,12,20,20,1,14,20,20,4,24
7060 data 18,1,1,8,12,20,20,2,23,18,1,1
7090 data 12,12,20,20,2,15,20,20,1,23,18,1,1
7120 rem
7150 rem author table full/empty checking and filling routine
7180 rem
7210 if ah$(1) <> "" then goto 7330 : rem if table is not empty, jump
7240 at = val(p2$)
7270 for x = 1 to at
7300 input#3, ah$(x): next
7330 return
7360 rem
7390 rem convert record pointer to binary
7420 rem
7450 r1=val(p1$):r2=0: if r>256then r2=int(r1/256):r1=r1-256*r2
7480 return
7510 rem
7540 rem this routine bumps "at", the author table pointer
7570 rem and puts the author and the pointer "pf$" in the table
7600 rem
7630 ah$(at) = f2$: at = at + 1
7660 ah$(at